package com.fg.tliaswebmanagement.common;

import lombok.Data;

@Data
public class Result {

    /**
     * 请求状态码：0=成功，1=失败
     */
    private int code;
    private String message;
    private Object data;

    public Result() {
    }

    public Result(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public Result(int code, String message, Object data) {
        this.code = code;
        this.message = message;
        this.data = data;
    }

    public static Result success() {
        return new Result(0,"成功");
    }

    public static Result success(Object data) {
        return new Result(0,"成功",data);
    }

    public static Result error(String msg) {
        return new Result(1,msg);
    }

}
